package com.sntk.registermanager.staff.domain.model;

import com.sntk.registermanager.common.domain.model.ValueObject;
import com.sntk.registermanager.common.exception.ObjectDisbaledException;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public class User extends ValueObject {
    //账户名-唯一
    private String uname;

    //用户名称
    private String userName;

    private Boolean disabled;
    public boolean normal(){
        return !this.disabled;
    }

    public void normalException(){
        if(!normal()){
            throw new ObjectDisbaledException(this.userName+"用户不可用");
        }
    }
}
